/**
 * Project: complex.remoting
 * 
 * File Created at 2010-8-19
 * $Id$
 * 
 * Copyright 1999-2100 Alibaba.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Alibaba Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Alibaba.com.
 */
package springremoting.rmi;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

public class HelloImpl extends UnicastRemoteObject implements HelloInterface {

    private static final long serialVersionUID = -4497383228004817199L;

    private String            message;

    /**
     * 必须定义构造方法，即使是默认构造方法，也必须把它明确地写出来，因为它必须抛出出RemoteException异常
     */
    public HelloImpl(String message) throws RemoteException {
        this.message = message;
    }

    /**
     * 远程接口方法的实现
     */
    @Override
    public String say() throws RemoteException {
        System.out.println("invoke say method.");
        return message;
    }

}
